﻿#include "ArrayStack.h"

int ArrayStack::getSize() {
	return this->arrayStack.size();
}

bool ArrayStack::isEmpty() {
	return this->arrayStack.size() == 0 ? true : false;
}
void ArrayStack::push(int num) {
	this->arrayStack.push_back(num);
}
int ArrayStack::getTop() {
	if (isEmpty())
		throw std::out_of_range("array stack is empty");
	//返回vector最后一个元素
	return this->arrayStack.back();
}

int ArrayStack::pop() {	
	this->arrayStack.pop_back();

}